package de.hs.rm.UJAdapter.impl;

import java.util.Dictionary;

import javax.management.Attribute;

import org.osgi.service.upnp.UPnPStateVariable;

public class UJActionSetter extends UJAction {
	
	@Override
	public Dictionary invoke(Dictionary args) throws Exception {
		
		Object[] params = {args.elements()};
		
		mBeanServerConnection.setAttribute(objName
				, new Attribute(stateVariable.getName(), args.get(stateVariable.getName())));
		stateVariable.setCurrentValue(args.get(stateVariable.getName()));
		//mBeanServerConnection.invoke(objName, name, params, null);
		
		return null;
	}
	
	@Override
	public UPnPStateVariable getStateVariable(String argumentName) {
		return stateVariable;
	}

}
